/**
 * 设备日志
 * @type {[type]}
 */
 const mongoose = require('mongoose')

 const { Schema } = mongoose
 
 
 const EquipmentLogSchema = new Schema({
                                                               
     enterprise_id: {type: Schema.Types.ObjectId, ref: 'enterprise', required: true},       //企业外键  数据权限

     cabinet_id: {type: Schema.Types.ObjectId, ref: 'cabinet', required: true},       //储存柜外键  数据权限

     equipment_id: {type: Schema.Types.ObjectId, ref: 'equipment', required: true},       //设备外键
 
     equipment_code: {type: String}, // 设备编号

     real_num: {type: Number}, // 实时数值

     remarks: { type: String }, //备注数据

     num_status: {type: Number, enum: [1,2], default: 1}, // 数值状态 1：正常 2：异常

     status: {type: Number, enum: [1,2], default: 1},  //状态 1、正常 2、删除
 
     create_at: { type: Date, default: Date.now, index: -1,select: true },
    //  update_at: { type: Date, default: Date.now ,select: true},
 })
 
 
 
 mongoose.model('equipment_log', EquipmentLogSchema)
 module.exports = EquipmentLogSchema
 